Move augmented-Lagrangian pressure update into USERMAT to fix compile error#1
Move augmented-Lagrangian pressure update into USERMAT to fix compile error#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8113b91fac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ! Fill STRESS (Voigt) with 2nd PK stress (Total Lagrangian) | ||
| STRESS(1) = S2PK(1,1) | ||
| STRESS(2) = S2PK(2,2) | ||
| STRESS(3) = S2PK(3,3) | ||
| STRESS(4) = S2PK(1,2) | ||
| STRESS(5) = S2PK(2,3) | ||
| STRESS(6) = S2PK(1,3) |
There was a problem hiding this comment.
Guard Voigt writes for non-3D NTENS
This USERMAT assumes a 3D Voigt layout and writes STRESS(5) and STRESS(6) unconditionally. In ANSYS, 2D elements (plane strain/stress) use NTENS=4, so this will index past the end of STRESS (and later DDSDDE in the 1..6 loop), which can corrupt memory or crash the solver when the same material is used with 2D elements. If this routine is intended to be reusable, it should either restrict itself to 3D-only usage or branch on NTENS/NDI/NSHR to avoid writing components that don’t exist.
Useful? React with 👍 / 👎.
Motivation
USERMATsubroutine, which produced an undeclaredSTATEVreference and an end‑of‑file syntax error.Description
STATEV(1) = P + KAPPA * (J - 1.0D0)) into theUSERMATsubroutine immediately beforeRETURNso the pressure-like multiplier is updated in the correct scope.Testing
Codex Task